<template>
  <el-row loading>
    <el-col :span="24">
       <kdy-detail ref="kdyDetail"></kdy-detail>
       <kdyFpfw-edit ref="kdyfwfpEdit"></kdyfpfw-edit>
      <el-row >
         <el-col :span="6">
           <el-input placeholder="请输入快递员姓名" size="small" style="width:100%">
          </el-input>
        </el-col>
        <el-col :span="6">
           <el-input placeholder="请输入快递员电话" size="small" style="width:100%">
          </el-input>
        </el-col>
        <el-col :span="6">
          <el-button type="danger"  size="small" @click="queryAll()">搜索</el-button>
        </el-col>
      </el-row>
      </el-col>
       <el-col :span="24">
          <el-table :data="tableData" border style="width: 100%">
            <el-table-column prop="" label="编号" header-align="center"></el-table-column>
            <el-table-column prop="" label="姓名" header-align="center"></el-table-column>
            <el-table-column prop="" label="手机号" header-align="center"></el-table-column>
            <el-table-column prop="" label="所属机构" header-align="center"></el-table-column>
            <el-table-column prop="" label="快递员App账号" header-align="center" align="center"></el-table-column>
            <el-table-column label="操作" header-align="center" align="center" width="300">
              <template slot-scope="scope">
                <el-button v-show="edit" type="primary" size="mini"
                  @click="handlezyfwfp(scope.row)">作业范围分配</el-button>
                <el-button v-show="detail" type="primary" size="mini"
                  @click="handleDetailkdy(scope.row)">快递员详情</el-button>
              </template>
            </el-table-column>
          </el-table>
          <el-row>
        <el-col :span="24">
         <el-pagination
            background
            @size-change="handleSizeChange"
            @current-change="currentChange"
            :current-page.sync="page"
            :page-sizes="[2,4,6,8]"
            :page-size="pageSize"
            layout="total, sizes, prev, pager, next, jumper"
            :total="counts">
          </el-pagination>
        </el-col>
      </el-row>
        </el-col>
</el-row>
</template>
<script>
// import axios from 'axios'
import KdyDetail from '@/components/kdy/kdyDetail'
import KdyFpfwEdit from '@/components/kdy/zyfpfwEdit'
  export default {
    data() {
      return {
       detail:true,
       edit:true,
       tableData:[{}],
        loading: true,
        pageSize:2,//每页显示的条数
        page:1,//第一页
        counts:0 //共几条
      }
    },
    methods: {
      currentChange(val){
        this.page=val;
        this.queryAll();
      },
      handleSizeChange(val) {
        this.pageSize=val;
        this.queryAll();
        },
        //快递员详情
      handleDetailkdy() {
        this.loading = true
        this.$refs.kdyDetail.$emit('openDetailkdyDialog')
        this.loading = false
    },
    handlezyfwfp(){
        this.loading = true
        this.$refs.kdyfwfpEdit.$emit('openzyfpfwDialog')
        this.loading = false
    }
},
    components:{KdyDetail,KdyFpfwEdit},

  }

</script>
